﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace WinnerCMS.Data.Mapping
{
    public partial class TaskMap
        : EntityTypeConfiguration<WinnerCMS.Model.Task>
    {
        public TaskMap()
        {
            // table
            //ToTable("CMS_Task");

            // keys
            HasKey(t => t.Id);

            // Properties
            Property(t => t.Id)
                
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
                .IsRequired();
            Property(t => t.TaskName)
                
                .HasMaxLength(50)
                .IsRequired();
            Property(t => t.TaskActiveId)
                
                .IsRequired();
            Property(t => t.AwakenTime)
                
                .IsOptional();
            Property(t => t.IntervalMinute)
                
                .IsRequired();
            Property(t => t.EveryDayTime)
                .IsUnicode(false)
                .HasMaxLength(50)
                .IsOptional();
            Property(t => t.Week)
                
                .IsOptional();
            Property(t => t.UnexecuteType)
                
                .IsOptional();
            Property(t => t.LastRunTime)
                
                .IsOptional();
            Property(t => t.IsUsed)
                
                .IsRequired();
            Property(t => t.DLLName)
                
                .HasMaxLength(100)
                .IsOptional();
            Property(t => t.FullClassName)
                
                .HasMaxLength(100)
                .IsOptional();
            Property(t => t.CommandLine)
                
                .HasMaxLength(100)
                .IsOptional();

            // Relationships

            //InitializeMapping();
        }
    }
}

